package it.sebsibenal.server.dao.impl;

import it.sebsibenal.server.dao.UserGroupDAO;
import it.sebsibenal.shared.UserGroup;

import com.googlecode.objectify.Objectify;
import com.googlecode.objectify.ObjectifyService;
import com.googlecode.objectify.Query;

public class DatastoreUserGroupDAO extends AbstractDatastoreDAO<UserGroup> implements UserGroupDAO {

	public DatastoreUserGroupDAO() {
		super(UserGroup.class);
	}

	@Override
	public UserGroup findByName(String name) {
		Objectify ofy = ObjectifyService.begin();
		Query<UserGroup> q = ofy.query(UserGroup.class);
		q = q.filter("name", name);
		return q.get();
	}
	
	
	
	

}
